package tmproject.hlhj.fhp.anwser.utils

import android.content.Context
import tmproject.hlhj.fhp.anwser.customview.LoadingDialog

/**
 * Created by Never Fear   on 2018\8\21 0021.
Never More....
 */
object LoadingUtils {
    private var loadingDialog:LoadingDialog?=null

    fun showLoading(c:Context){
        if (null== loadingDialog){
            loadingDialog= LoadingDialog(c)
        }
        loadingDialog?.setOnDismissListener {
            loadingDialog=null
        }
        loadingDialog?.show()
    }
    fun loadingDismiss(){
        if (null!= loadingDialog){
            loadingDialog?.dismiss()
            loadingDialog=null
        }
    }
}